<template name="livestream">
	<view class="content">
		<cu-custom bgColor="bg-gradual-blue" :isBack="false"><block slot="content">视频监控</block></cu-custom>
		<view>
			<video :src="rtmpAddr" style="width: 100vw;height: 400rpx;" :autoplay="true" controls></video>
			<h2 style="margin: 20rpx;">输入视频源IP</h2>
			<input style="margin: 20rpx;" type="text" v-model="ipAddr" />
			<view class="padding flex flex-direction">
				<button class="cu-btn bg-blue margin-tb-sm lg" @click="generateRtmp">开始直播</button>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			ipAddr: '192.168.',
			rtmpAddr: 'rtmp://192.168.10.1/live'
		};
	},
	methods: {
		generateRtmp() {
			this.rtmpAddr = 'rtmp://' + this.ipAddr + '/live';
		}
	}
};
</script>

<style></style>
